home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat5 / ipa.z / ipa
Encoding:
Text File  |  2002-10-03  |  37.5 KB  |  692 lines

  1. IPA(5)                                                 Last changed: 4-9-99
  2.  
  3.  
  4. NNAAMMEE
  5.      IIPPAA - Inter-Procedural Analysis
  6.  
  7. IIMMPPLLEEMMEENNTTAATTIIOONN
  8.      IRIX systems
  9.  
  10. DDEESSCCRRIIPPTTIIOONN
  11.      This man page describes Inter-Procedural Analysis (IPA) in the MIPSpro
  12.      compilers and how to use it most efficiently.
  13.  
  14. IIPPAA OOvveerrvviieeww
  15.      Most compiler optimizations work within a single procedure (for
  16.      example, function or subroutine) at a time.  This helps keep the
  17.      problems manageable, and is a key aspect of supporting separate
  18.      compilation, because it allows the compiler to restrict attention to
  19.      the current source file.
  20.  
  21.      This intra-procedural focus also presents serious restrictions.  By
  22.      avoiding dependence on information from other procedures, an optimizer
  23.      is forced to make worst-case assumptions about the possible effects of
  24.      those procedures.  For instance, at boundary points including all
  25.      procedure calls, the compiler must typically save (and/or restore) the
  26.      state of all variables to or from memory.
  27.  
  28.      By contrast, IPA algorithms analyze more than a single procedure
  29.      (preferably the entire program) at once.  The optimizations performed
  30.      by the MIPSpro compilers' IPA utility include:
  31.  
  32.      * _I_n_l_i_n_i_n_g:  Calls to a procedure are replaced by a suitably modified
  33.        copy of the called procedure's body inline, even if the callee is in
  34.        a different source file.
  35.  
  36.      * _C_o_m_m_o_n _b_l_o_c_k _a_r_r_a_y _p_a_d_d_i_n_g:  Global arrays in Fortran may be padded
  37.        (that is, their size increased in order to reduce cache conflicts).
  38.  
  39.      * _C_o_n_s_t_a_n_t _p_r_o_p_a_g_a_t_i_o_n:  Formal parameters which always have a
  40.        particular constant value can be replaced by the constant, allowing
  41.        additional optimization.  Global variables which are initialized to
  42.        constant values and never modified can be replaced by the constant.
  43.  
  44.      * _D_e_a_d _f_u_n_c_t_i_o_n _e_l_i_m_i_n_a_t_i_o_n:  Functions which are never called can be
  45.        removed from the program image, improving memory utilization.
  46.  
  47.      * _D_e_a_d _v_a_r_i_a_b_l_e _e_l_i_m_i_n_a_t_i_o_n:  Variables which are never actually used
  48.        can be eliminated, along with any code that initializes them.
  49.  
  50.      * _G_l_o_b_a_l _n_a_m_e _o_p_t_i_m_i_z_a_t_i_o_n_s:  Global names in shared code must
  51.        normally be referenced via addresses in a global table, in case they
  52.        are defined or preempted by another dynamic shared object (DSO).  If
  53.        the compiler knows it is compiling a main program and that the name
  54.        is defined in another of the source files comprising the main
  55.        program, an absolute reference can be substituted, eliminating a
  56.        memory reference.  For example, the following code can be used to to
  57.        load XX:
  58.  
  59.             lw $4,%got_disp(X),$gp
  60.             ld $5,0,$4
  61.  
  62.        It could be changed to the following:
  63.  
  64.             lui $4,%hi(X)
  65.             ld $5,%lo(X),$4
  66.  
  67.      Similarly, IPA can optimize the data items that can be referenced by
  68.      simple offsets from the GP register instead of depending on the user
  69.      to provide an ideal value of the --GG option (see cccc(1) or ff7777(1)).
  70.  
  71. IIPPAA aanndd CCoommppiillaattiioonn
  72.      Because IPA must usually process code from multiple source files to be
  73.      effective, it has significant effects on compilation.  These can be
  74.      classified as affecting either the program build process itself, or
  75.      the attributes of the resulting program.
  76.  
  77.    TThhee BBuuiilldd PPrroocceessss
  78.      The standard Unix C or Fortran compilation model involves two steps.
  79.      First, each source file comprising a program is compiled independently
  80.      of the others, producing a relocatable _o_b_j_e_c_t file with the ..oo
  81.      extension.  Then, the resulting object files are linked, along with
  82.      any standard libraries, by lldd(1).
  83.  
  84.      IPA works by postponing much of the compilation process until the link
  85.      step, when all of the program components can be analyzed together.
  86.      Specifically, the following occurs:
  87.  
  88.      * The _c_o_m_p_i_l_e _s_t_e_p does initial processing of the source file, placing
  89.        an intermediate representation of the procedures it contains into
  90.        the output ..oo file instead of normal relocatable code.  Such object
  91.        files are called _W_H_I_R_L _o_b_j_e_c_t_s to distinguish them from normal
  92.        relocatable object files.
  93.  
  94.        This choice is invoked by the --IIPPAA:: option.  This processing is
  95.        really two phases:  the normal language processing, plus an IPA
  96.        summary phase which collects local information to be used by IPA
  97.        later.  Because most optimization and code generation options are
  98.        transmitted via the IPA summary phase, they must be present on the
  99.        command line for the compile step.
  100.  
  101.      * The _l_i_n_k _s_t_e_p, although it is still invoked by a single lldd(1)
  102.        command, becomes several steps.
  103.  
  104.        First, the linker invokes IPA, which analyzes and transforms all of
  105.        the input WHIRL objects together, writing modified versions of the
  106.        objects.  Then it invokes the compiler on each of the modified
  107.        objects, producing a normal relocatable object.  Finally, it invokes
  108.        the linker again for a normal linkage step, producing an executable
  109.        program or DSO.
  110.  
  111.        The temporary files created during this expanded link step are all
  112.        created in a temporary subdirectory of the output program's
  113.        directory, unless the environment variable TTMMPPDDIIRR is specified, in
  114.        which case the temporary subdirectory is created under $$TTMMPPDDIIRR; like
  115.        other temporary files produced by the compilation process, they are
  116.        normally removed on completion (unless the --kkeeeepp option is specified
  117.        with the compiler command).
  118.  
  119.      IPA increases program build time in two ways.  First, although the IPA
  120.      step may not be very expensive itself, it usually increases the size
  121.      of the code by inlining, and therefore expands the time required by
  122.      the rest of the compiler.  More importantly, because IPA analysis can
  123.      propagate information from one module into optimization decisions in
  124.      arbitrary other modules, even minor changes to a single component
  125.      module cause most of the program compilation to be redone.  As a
  126.      result, IPA is best suited for use on programs with a stable source
  127.      base.
  128.  
  129.      Because full IPA is not always suitable, the MIPSpro compilers also
  130.      support inlining without IPA in cases where both the call and the
  131.      called subprogram are in the same file.  This feature, called the
  132.      _s_t_a_n_d_a_l_o_n_e _i_n_l_i_n_e_r, is invoked by default when inlining is specified
  133.      in C++, or may be explicitly invoked using the --IINNLLIINNEE options
  134.      (described following).
  135.  
  136.    PPrrooggrraamm AAttttrriibbuutteess
  137.      Like most optimization performed by the compiler, IPA should not
  138.      change the program's behavior.  Nevertheless, it can affect the
  139.      resulting program in subtle ways.
  140.  
  141.      The most important effects involve external symbols and DSOs.  Unlike
  142.      other IPA implementations, the MIPSpro compiler does not require that
  143.      all of the components of a program be subjected to IPA analysis.  The
  144.      lldd(1) command which invokes IPA may include object files (..oo) and
  145.      archives (..aa) which have been compiled normally without IPA analysis,
  146.      as well as referencing DSOs which, however they were compiled, cannot
  147.      contribute detailed information because the DSO may be replaced with a
  148.      different implementation after the program is built.
  149.  
  150.      To analyze the program's use (and non-use) of variables, IPA must
  151.      determine what those unanalyzed objects might reference.  It does so
  152.      by examining their external symbol references.  If an external symbol
  153.      is never referenced by one of the unanalyzed objects, and its address
  154.      is never taken in the code being analyzed, IPA can assume that the
  155.      only possible way for the unanalyzed code to access the named object
  156.      is if it passed as a parameter to an unanalyzed subprogram.
  157.      Otherwise, it must make worst-case assumptions.
  158.  
  159.      This approach is safe for normal relocatable objects and archives,
  160.      because they cannot be changed without rebuilding (and reanalyzing)
  161.      the program.  For DSOs, however, there is a danger that a modified
  162.      version will make additional references.  To prevent this from causing
  163.      changed program behavior, IPA changes all of the external symbols
  164.      which it assumes to be unreferenced to HHIIDDDDEENN or IINNTTEERRAALL export class,
  165.      which prevents them from being referenced inadvertently by a future
  166.      version of the DSO.  The DSO case is safe as well.
  167.  
  168.      The DSO treatment does have an important side effect, though.  All
  169.      referenced DSOs should be referenced on the lldd(1) command line.
  170.      Otherwise, their external references will not be seen by IPA, and the
  171.      symbols they require may not be visible at runtime, causing failure.
  172.      If you cannot give references to all DSOs used (for example because
  173.      you will be accessing them with ddllooppeenn(3) and don't want them
  174.      automatically loaded with your program), then you must provide an
  175.      explicit exported symbol list with the --eexxppoorrtteedd__ssyymmbbooll or lldd(1)
  176.      options.  See ddssoo(5) for more information.
  177.  
  178.      Because IPA combines code from multiple source files, it is
  179.      recommended that the same compilation options be used for every source
  180.      file that is compiled with IPA analysis.  If it is important for a
  181.      single file to be given unusual compilation options that would be
  182.      inappropriate for the rest of the program (such as rounding mode
  183.      control), it is recommended that that file be compiled without IPA
  184.      analysis.
  185.  
  186. IIPPAA OOppttiioonnss
  187.      IPA is controlled from the command line with two option groups.
  188.      --IINNLLIINNEE::  controls inlining by the standalone inliner.  It should be
  189.      used on your compile command line.  --IIPPAA:: controls general IPA
  190.      choices.  If you use separate compile and link steps (i.e. using --cc
  191.      when you compile and then linking the ..oo files produced with a
  192.      separate cccc, ff7777, or lldd command), then you need to use --IIPPAA for the
  193.      compile step, with or without individual options described below, and
  194.      also for the link step with any of the following options desired.
  195.  
  196.      The command line format used for group options is
  197.  
  198.           -_g_r_o_u_p_n_a_m_e::_o_p_t_i_o_n[[==_v_a_l_u_e]][[::_o_p_t_i_o_n_2[[==_v_a_l_u_e_2]]]]......
  199.  
  200.      The _g_r_o_u_p_n_a_m_e (IIPPAA or IINNLLIINNEE) is followed by a colon-separated list of
  201.      options, each of which is an option name possibly followed by an equal
  202.      sign and a value.  The option names may generally be abbreviated by
  203.      truncating them to a unique prefix (which may change when new options
  204.      are added to the group).
  205.  
  206.      Some _o_p_t_i_o_ns are specified with a setting that will enable or disable
  207.      the feature.  To enable a feature, specify the option alone or with
  208.      ==11, ==OONN, or ==TTRRUUEE; to disable the feature, specify the option with ==00,
  209.      ==OOFFFF, or ==FFAALLSSEE.  This man page only shows the OONN or OOFFFF settings, but
  210.      the other settings are equally valid.
  211.  
  212.    IINNLLIINNEE OOppttiioonnss
  213.      The IINNLLIINNEE option calls the standalone inliner option group, which
  214.      controls the application of subroutine inlining done by the standalone
  215.      inliner, or by the main inliner if --IIPPAA options are enabled.
  216.      Normally, the calls to be replaced by an inlined copy of the called
  217.      subprogram are chosen by heuristics internal to the inliner.
  218.  
  219.      Most of the options in this group provide control over those choices.
  220.      The individual controls in this group are:
  221.  
  222.      ==((_s_e_t_t_i_n_g))
  223.                Enables or disables stand-alone inlining processing. _s_e_t_t_i_n_g
  224.                can be either OONN or OOFFFF.
  225.  
  226.                This is ignored with a warning for compiles which invoke
  227.                main IPA processing.  When both are used in the command line
  228.                (for a compile which will not invoke main IPA processing),
  229.                ==OOFFFF is processed and ==OONN is overridden with a warning.  If
  230.                used within a specfile read by the stand-alone inliner, ==OOFFFF
  231.                skips inline processing within the stand-alone inliner and
  232.                ==OONN is ignored with a warning.
  233.  
  234.      aallll       Changes the default inlining heuristic to attempt to inline
  235.                all routines which are not excluded by a nneevveerr option or a
  236.                pragma suppressing inlining, either for the routine or for a
  237.                specific callsite.  This option conflicts with nnoonnee; aallll
  238.                takes precedence if both are specified. This option may
  239.                cause performance problems because the size of the
  240.                procedures may be very large after inlining. If this option
  241.                must be used, then increase the OOlliimmiitt by using the
  242.                --OOPPTT::OOlliimmiitt==_n option to enable procedures to be optimized.
  243.                See the oopptt(5) man page for details.  This may affect
  244.                compilation speed.
  245.  
  246.      aallllooccaa[[==_s_e_t_t_i_n_g]]
  247.                Enables save/restore of stack when inlining calls with
  248.                aallllooccaa.  _s_e_t_t_i_n_g can be either OONN or OOFFFF.  If the callee has
  249.                an alloca, then inlining it would normally remove the
  250.                function boundary at which the dynamic space would have been
  251.                released.  This option saves and restores the stack pointer
  252.                before and after the inlined code. Having the option OONN is
  253.                essential for correctness (for example, in code where the
  254.                callee is inside a loop).  The default is OONN.
  255.  
  256.      ddffee[[==_s_e_t_t_i_n_g]]
  257.                Performs dead function elimination in the standalone
  258.                inliner.  _s_e_t_t_i_n_g can be either OONN or OOFFFF.  This option
  259.                removes any functions that are inlined everywhere they are
  260.                called and are not visible outside the current module.
  261.                C/C++: the default is TTRRUUEE when not compiled with --gg, FFAALLSSEE
  262.                otherwise.
  263.  
  264.      ffiillee==_f_i_l_e_n_a_m_e
  265.                Provides cross-file inlining from within the stand-alone
  266.                inliner. The option searches for routines provided in a
  267.                --IINNLLIINNEE::mmuusstt list option, in the _f_i_l_e_n_a_m_e specified. The
  268.                _f_i_l_e_n_a_m_e provided by this option must be generated using the
  269.                --IIPPAA --cc option.  The file generated contains information
  270.                used to perform cross-file inlining.
  271.  
  272.                For example, suppose the following two files exist:  ffoooo..ff
  273.                and bbaarr..ff. The following is part of the code from ffoooo..ff:
  274.  
  275.                     program main
  276.  
  277.                      ....
  278.  
  279.                     call bar()
  280.  
  281.                     end
  282.  
  283.                The following is partial code from bbaarr..ff:
  284.  
  285.                     subroutine bar()
  286.  
  287.                      ...
  288.  
  289.                     end
  290.  
  291.                To inline bbaarr into mmaaiinn using the stand-alone inliner,
  292.                compile bbaarr..ff in the following way:
  293.  
  294.                     f77 -n32 -IPA -c bar.f
  295.  
  296.                This produces the file, bbaarr..oo.  To inline bbaarr into ffoooo..ff,
  297.                use:
  298.  
  299.                     f77 -n32 foo.f -INLINE:must=bar_:file=bar.o
  300.  
  301.      kkeeeepp__ppuu__oorrddeerr[[==_s_e_t_t_i_n_g]]
  302.                Preserves source subprogram ordering.  The default is OOFFFF.
  303.  
  304.      lliibbrraarryy==_n_a_m_e
  305.                Identifies archive libraries where the inliner should search
  306.                for subprograms.  This option is similar to --IINNLLIINNEE::ffiillee==,
  307.                described previously, where the files (..oo) in the archived
  308.                library (..aa) must have been generated using the --IIPPAA --cc
  309.                options.  For example, suppose function FFOOOO is defined in
  310.                ffooooffiillee..ff. The ffooooffiillee..ff was compiled with --IIPPAA --cc and
  311.                transformed into an archive with this command:
  312.  
  313.                     aarr rrvv ffoooolliibb..aa ffooooffiillee..oo
  314.  
  315.                The following command will inline the function ffoooo from
  316.                ffooooffiillee..oo (which is automatically extracted from ffoooolliibb..aa)
  317.                into bbaarr..cc via the crossfile inlining mechanism described
  318.                above:
  319.  
  320.                     cc -n32 -INLINE:must=foo:library=foolib.a bar.c
  321.  
  322.      lliisstt[[==_s_e_t_t_i_n_g]]
  323.                List inlining actions as they occur to ssttddeerrrr.  The default
  324.                is OOFFFF.
  325.  
  326.      mmaaxx__ppuu__ssiizzee__iinnlliinnee[[==_n]]
  327.                Limits the size of inlined subprograms to _n.  The default is
  328.                5000.  Inlining is disabled if, after inlining, the caller
  329.                exceeds this size.
  330.  
  331.      mmuusstt==_n_a_m_e_1[[,,_n_a_m_e_2]]
  332.                Directs IPA to always attempt to inline any routines with
  333.                names _n_a_m_e_1, _n_a_m_e_2, independent of the default inlining
  334.                heuristic.  For C++, the names given must be the "mangled"
  335.                names (see NOTES).  For Fortran, the name given may be
  336.                either the original name, or the external name with the
  337.                underscore appended by the compiler.  In all cases, the
  338.                option applies to all routines encountered with the given
  339.                name, whether ssttaattiicc or eexxtteerrnn.  In C, a pragma suppressing
  340.                inlining at a particular callsite takes precedence over this
  341.                option.
  342.  
  343.      nneevveerr==_n_a_m_e_1[[,,_n_a_m_e_2]]
  344.                Directs IPA to never attempt to inline any routines with the
  345.                names _n_a_m_e_1, _n_a_m_e_2, independent of the default inlining
  346.                heuristic.  For C++, the names given must be the "mangled"
  347.                names (see NOTES).  For Fortran, the name given may be
  348.                either the original name, or the external name with the
  349.                underscore appended by the compiler.  In all cases, the
  350.                option applies to all routines encountered with the given
  351.                name, whether ssttaattiicc or eexxtteerrnn.  A pragma requesting
  352.                inlining at a particular callsite takes precedence over this
  353.                option.
  354.  
  355.      nnoonnee      Changes the default inlining heuristic so the compiler does
  356.                not attempt to inline any routines which are not specified
  357.                by a mmuusstt option or a pragma requesting inlining, either for
  358.                the routine or for a specific callsite.  This option
  359.                conflicts with aallll; aallll takes precedence if both are
  360.                specified.
  361.  
  362.      pprreeeemmpptt[[==_s_e_t_t_i_n_g]]
  363.                Enables inlining of functions marked preemptible in the
  364.                standalone inliner.  The default is OOFFFF.  Such inlining
  365.                prevents another definition of such a function in another
  366.                DSO from pre-empting the definition of the function being
  367.                inlined.
  368.  
  369.      ssppeeccffiillee==_f_i_l_e_n_a_m_e
  370.                Opens _f_i_l_e_n_a_m_e to read additional options.  The
  371.                specification file contains zero or more lines with inliner
  372.                options in the form expected on the command line.
  373.  
  374.                For example, the file might contain a single line, similar
  375.                to the following:
  376.  
  377.                     INLINE:never=errfunc:must=accessor,solver
  378.  
  379.                It can also contain multiple lines, as in the following:
  380.  
  381.                     INLINE:all
  382.                     INLINE:never=errfunc
  383.  
  384.                The ssppeeccffiillee option cannot occur in a specification file, so
  385.                specification files cannot invoke other specification files.
  386.  
  387.      ssttaattiicc[[==_s_e_t_t_i_n_g]]
  388.                Performs inlining of static functions in the standalone
  389.                inliner.  _s_e_t_t_i_n_g can be either OONN or OOFFFF.  C/C++: The
  390.                default is TTRRUUEE at --OO22 optimization levels, FFAALLSSEE otherwise.
  391.  
  392.    IIPPAA OOppttiioonnss
  393.      The IIPPAA options control the interprocedural analyses and
  394.      transformations performed.  Using the group name without any options
  395.      (for example, --IIPPAA) invokes IPA with the default settings.
  396.  
  397.      When --aappookkeeeepp, --ppccaakkeeeepp, or --ppffaakkeeeepp are specified in conjunction with
  398.      --iippaa or --IIPPAA, the default settings for IPA suboptions are used with
  399.      the exception of the iinnlliinnee==_s_e_t_t_i_n_g suboption, which is set to OOFFFF.
  400.  
  401.      The individual controls in this group are:
  402.  
  403.      aaddddrreessssiinngg[[==_s_e_t_t_i_n_g]]
  404.                Enables or disables the analysis of address operator usage.
  405.                _s_e_t_t_i_n_g can be either OONN or OOFFFF.  --IIPPAA::aalliiaass==OONN is a
  406.                prerequisite.  The default is OOFFFF.
  407.  
  408.      aaggggrr__ccpprroopp[[==_s_e_t_t_i_n_g]]
  409.                Enables or disables aggressive interprocedural constant
  410.                propagation.  _s_e_t_t_i_n_g can be either OONN or OOFFFF.  Attempts to
  411.                avoid passing constant parameters, replacing the
  412.                corresponding formal parameters by the constant values.  By
  413.                default, less aggressive interprocedural constant
  414.                propagation is done.  The default is OOFFFF.
  415.  
  416.      aalliiaass[[==_s_e_t_t_i_n_g]]
  417.                Enables or disables alias/mod/ref analysis. _s_e_t_t_i_n_g can be
  418.                OONN or OOFFFF.  The default is OOFFFF.
  419.  
  420.      aauuttooggnnuumm[[==_s_e_t_t_i_n_g]]
  421.                Determines the optimal value of the --GGnnuumm option.  _s_e_t_t_i_n_g
  422.                can be OONN or OOFFFF.  This option identifies a size bound below
  423.                which data can be allocated relative to the global pointer
  424.                and accessed cheaply.  This optimization is turned off when
  425.                --mmuullttiiggoott is specified in the linker command line.  The
  426.                default is OONN.  See also --IIPPAA::GGnnuumm.
  427.  
  428.      ccggii[[==_s_e_t_t_i_n_g]]
  429.                Enables or disables constant global variable identification.
  430.                _s_e_t_t_i_n_g can be OONN or OOFFFF.  This option marks non-scalar
  431.                global variables which are never modified as constant, and
  432.                propagates their constant values to all files.  The default
  433.                is OONN.
  434.  
  435.      ccoommmmoonn__ppaadd__ssiizzee==_n
  436.                Specifies the amount by which to pad common block array
  437.                dimensions.  By default, the compiler automatically chooses
  438.                the amount of padding to improve cache behavior for common
  439.                block array accesses.
  440.  
  441.      ccpprroopp[[==_s_e_t_t_i_n_g]]
  442.                Enables or disables interprocedural constant propagation.
  443.                _s_e_t_t_i_n_g can be OONN or OOFFFF.  This option identifies formal
  444.                parameters which always have a specific constant value.  The
  445.                default is OONN.  See also --IIPPAA::aaggggrr__ccpprroopp.
  446.  
  447.      ddeepptthh==_n   This option is identical to mmaaxxddeepptthh==_n.
  448.  
  449.      ddffee[[==_s_e_t_t_i_n_g]]
  450.                Enables or disables dead function elimination.  _s_e_t_t_i_n_g can
  451.                be OONN or OOFFFF.  This option removes subprograms which are
  452.                never called from the program.  The default is OONN.
  453.  
  454.      ddvvee[[==_s_e_t_t_i_n_g]]
  455.                Enables or disables dead variable elimination.  _s_e_t_t_i_n_g can
  456.                be OONN or OOFFFF.  This option removes variables which are never
  457.                referenced from the program. The default is OONN.
  458.  
  459.      eecchhoo[[==_s_e_t_t_i_n_g]]
  460.                Echo (to ssttddeerrrr) the compile commands and the final link
  461.                command which are invoked from IPA.  _s_e_t_t_i_n_g can be OONN or
  462.                OOFFFF.  This can help monitor progress of a large system
  463.                build.  The default is OOFFFF.
  464.  
  465.      ffoorrcceeddeepptthh==_n
  466.                Sets inline depths.  Instead of the default inlining
  467.                heuristics, this options directs IPA to attempt to inline
  468.                all functions at a depth of (at most) _n in the callgraph,
  469.                where functions which make no calls are at depth 0, those
  470.                which call only depth 0 functions are at depth 1, and so on.
  471.                This ignores the default heuristic limits on inlining.
  472.  
  473.      GGffaaccttoorr==_n Sets percentage for GOT multiplication.  _n is the percentage
  474.                used to multiply the estimated external GOT entries for
  475.                estimating the total ..ggoott size. A value of _n=200 means that
  476.                IPA will multiply the estimated external GOT entries by 2 to
  477.                get the estimated total ..ggoott size.  The default is 220000.
  478.  
  479.      GGnnuumm==_n    User-specified GGnnuumm.  The default is no limit.
  480.  
  481.      GGssppaaccee==_n  User-specified size (in bytes) for the area where IPA can
  482.                allocate data that can be referenced relative to the global
  483.                pointer.  The default is 64 Kbytes, which is the maximum
  484.                valid value.
  485.  
  486.      ggpp__ppaarrttiittiioonn[[==_s_e_t_t_i_n_g]]
  487.                Enables partitioning for archiving different GP-groups, as
  488.                specified by the user externally or determined by IPA
  489.                internally. _s_e_t_t_i_n_g can be OONN or OOFFFF.  This option basically
  490.                enables --IIPPAA ppiiccoopptt in the presence of --mmuullttiiggoott.  The
  491.                default is OOFFFF.
  492.  
  493.      iinnlliinnee[[==_s_e_t_t_i_n_g]]
  494.                Performs inter-file subprogram inlining during main IPA
  495.                processing.  _s_e_t_t_i_n_g can be OONN or OOFFFF.  The default is OONN.
  496.                This does not affect the standalone inliner.
  497.  
  498.      iinnttrriinnssiiccss==_n
  499.                Sets the number of Fortran intrinsic functions in the GOT
  500.                area. This number is added to the estimated external GOT
  501.                entries to get the estimated total ..ggoott size. IPA has
  502.                difficulty in estimating the number of Fortran intrinsic
  503.                functions that will be added by the Lowerer after the IPA
  504.                phase.
  505.  
  506.      kkeeeepplliigghhtt[[==_s_e_t_t_i_n_g]]
  507.                Directs IPA to not send --kkeeeepp to the compiler, in order to
  508.                save space. _s_e_t_t_i_n_g can be OONN or OOFFFF.  The default is OOFFFF.
  509.  
  510.      lliinneeaarr[[==_s_e_t_t_i_n_g]]
  511.                Sets linearization of array references.  _s_e_t_t_i_n_g can be OONN
  512.                or OOFFFF.  When inlining Fortran subroutines, IPA tries to map
  513.                formal array parameters to the shape of the actual
  514.                parameter.  It may not always be able to always map it. In
  515.                the case that it cannot map the parameter, it linearizes the
  516.                array reference. By default, it will not inline such
  517.                callsites because they may cause performance problems.  The
  518.                default is OOFFFF.
  519.  
  520.      mmaapp__lliimmiitt==_n
  521.                Controls when IPA enables sspp__ppaarrttiittiioonn.   _n is the maximum
  522.                size (in bytes) of input files mapped before IPA does --IIPPAA
  523.                sspp__ppaarrttiittiioonn.
  524.  
  525.      mmaaxxddeepptthh==_n
  526.                Directs IPA to not attempt to inline functions at a depth of
  527.                more than _n in the callgraph, where functions which make no
  528.                calls are at depth 0, those which call only depth 0
  529.                functions are at depth 1, and so on.  Inlining remains
  530.                subject to overriding limits on code expansion.  See also
  531.                ffoorrcceeddeepptthh, ssppaaccee, and pplliimmiitt.
  532.  
  533.      mmaaxx__jjoobb==_n Limits the maximum parallelism when invoking the compiler
  534.                after IPA to (at most) _n compilations running at once.  The
  535.                default is 2 on a uniprocessor host, 4 on a multiprocessor
  536.                host.
  537.  
  538.      mmuullttii__cclloonnee==_n
  539.                Specifies the maximum number of clones that can be created
  540.                from a single procedure.  By default, this value is 0.
  541.                Aggressive procedure cloning may provide opportunities for
  542.                interprocedural optimization, but it also may significantly
  543.                increase the code size.
  544.  
  545.      nnooddee__bbllooaatt==_n
  546.                When used in conjunction with IIPPAA::mmuullttii__cclloonnee, this
  547.                specifies the maximum percentage growth of the total number
  548.                of procedures relative to the original program.
  549.  
  550.      ppaarrttiittiioonn__ggrroouupp==[[ssyymmbboollnnaammee[[%%_s_y_m_b_o_l]]||_f_i_l_e_n_a_m_e%%FF]]]]......
  551.                Specifies EXTERNAL symbols belonging to the same group.  All
  552.                unspecified symbols are considered by IPA as belonging to
  553.                the COMMON group, which has the properties of always being
  554.                in memory and available for inlining.  Following the
  555.                ssyymmbboollnnaammee, the user can specify the properties for that
  556.                symbol by adding a percentage symbol (%), followed by the
  557.                property wanted.
  558.  
  559.                _s_y_m_b_o_l can be II or GG.  II indicates symbol is used only
  560.                within the partition, or GG indicates symbol should be marked
  561.                as GP-relative, for DDAATTAA symbols only.
  562.  
  563.                Instead of specifying the symbol, the user can specify a
  564.                ggpp__ppaarrttiittiioonn per file, as in the following:
  565.  
  566.                     partition_group=file_name%F
  567.  
  568.                Then every defined EXTERNAL symbol that exists in that file
  569.                will have the same group. ffiillee__nnaammee must be specified in the
  570.                same way that the file is specified in the link-line.  See
  571.                the following example:
  572.  
  573.         cc -IPA:gp_partition=on:partition_group=
  574.         /usr/tmp/p007.o%F:partition_group=./add.o%F /usr/tmp/p007.o ./add.o
  575.  
  576.      ppiiccoopptt[[==_s_e_t_t_i_n_g]]
  577.                Performs PIC optimizations.  This involves turning
  578.                preemptible symbols to non-preemptible symbols whenever
  579.                possible, either through IPA's own analysis or through user
  580.                specifications (required to build DSOs).  The following are
  581.                major benefits of this action:
  582.  
  583.                * Enables other IPA optimizations such as inlining, constant
  584.                  propagation, DFE, etc.
  585.  
  586.                * Turns indirect calls to direct calls.
  587.  
  588.                * Eliminates the generation of GP-prologs, thus generating
  589.                  fewer instructions.
  590.  
  591.                The preceding benefits are automatically accomplished by IPA
  592.                for building executables.  To obtain similar benefits for
  593.                building DSOs, the user must specify which symbols are
  594.                preemptible.  This can be done by using the lldd --eexxppoorrttss__ffiillee
  595.                option. See the lldd man page for details.  The default is OONN.
  596.  
  597.      pplliimmiitt==_n  Stops inlining into a particular subprogram once it reaches
  598.                size _n in the intermediate representation.  The default is
  599.                2500.
  600.  
  601.      rreelloopptt[[==_s_e_t_t_i_n_g]]
  602.                Enables optimizations similar to those achieved with the
  603.                compiler options --OO33 and --cc, where objects are built with
  604.                the assumption that the compiled objects will be linked into
  605.                a call-shared executable later. _s_e_t_t_i_n_g can be OONN or OOFFFF.
  606.                In effect, optimizations based on position-dependent code
  607.                (non-PIC) are performed on those objects.  The default is
  608.                OOFFFF.
  609.  
  610.      ssppaaccee==_n   Stops inlining when the program size has increased by _n%.
  611.                For example, _n=20 limits code expansion due to inlining to
  612.                approximately 20%.  The default is 100%.
  613.  
  614.      sspp__ppaarrttiittiioonn==[[_s_e_t_t_i_n_g]]
  615.                Enables partitioning for disk/address-saving purpose.
  616.                _s_e_t_t_i_n_g can be OONN or OOFFFF.  Mainly used for building huge
  617.                programs (for example, PTC). Partitioning should normally be
  618.                done by IPA internally.  The default is OOFFFF.
  619.  
  620.      ssppeeccffiillee==_f_i_l_e_n_a_m_e
  621.                Opens _f_i_l_e_n_a_m_e to read more options.  A specfile contains
  622.                zero or more of the options allowed by IPA. In the following
  623.                example, --IIPPAA::ssppeeccffiillee==ooppttiioonn__ffiillee, the ooppttiioonn__ffiillee can be
  624.                used to specify anything for -IPA as if it is specified in
  625.                the command line, as in this example:
  626.  
  627.       -IPA:gp_partition=on:partition_group=p007.o%F:partition_group=add.o%F
  628.  
  629.                Because ssppeeccffiillee== is not legal within a specfile, a specfile
  630.                cannot point at other specfiles.
  631.  
  632.      uussee__iinnttrriinnssiicc[[==_s_e_t_t_i_n_g]]
  633.                Enables loading the intrinsic version of standard library
  634.                functions.  This option causes inlining of the mmaalllloocc
  635.                library.  This improves small object allocations, but is not
  636.                mmpp safe.  _s_e_t_t_i_n_g can be OONN or OOFFFF.  The default is OOFFFF.
  637.  
  638. NNOOTTEESS
  639.      Both IPA and standalone inlining are disabled when --gg is specified on
  640.      the compiler's command line.
  641.  
  642.    CC//CC++++ MMaanngglleedd NNaammee
  643.      For specifying routine names to the --IINNLLIINNEE::nneevveerr==_n_a_m_e and
  644.      --IINNLLIINNEE::mmuusstt==_n_a_m_e options for C++ programs, the _m_a_n_g_l_e_d internal name
  645.      must be used.  Because C++ allows overloading (that is, the use of the
  646.      same name for multiple objects which can be distinguished by type), it
  647.      uses internal names which are constructed from the original name and
  648.      an encoded version of the object's type.  To find this mangled name,
  649.      do the following:
  650.  
  651.      * Compile the source module where the name is defined, as in this
  652.        example:
  653.  
  654.           CC -c source.cxx -o source.o
  655.  
  656.      * Use the original name to find the mangled name in the object file
  657.        using nnmm(1) and ggrreepp(1).  For example, if the original name was
  658.        _m_y_s_u_b, use the following:
  659.  
  660.           nm -B source.o | grep mysub
  661.           0f89f950 T mysub__10yourclassFv
  662.           0f89facc T mysub__10myclassFv
  663.  
  664.      * The previous commands might produce several potential matches,
  665.        particularly if overloading is actually occurring.  If so, use the
  666.        cc++++ffiilltt filter to determine which one is the one you want:
  667.  
  668.           /usr/lib/c++/c++filt
  669.           mysub__10myclassFv
  670.           myclass::mysub(void)
  671.  
  672.        You can continue entering possible names until one of them matches
  673.        the name you want.
  674.  
  675. SSEEEE AALLSSOO
  676.      cccc(1), ff7777(1), lldd(1)
  677.      ddssoo(5)
  678.  
  679.      _M_I_P_S_p_r_o _C _a_n_d _C++ _P_r_a_g_m_a_s, publication 007-3587-001
  680.  
  681.      _C _L_a_n_g_u_a_g_e _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication 007-0701-120
  682.  
  683.      _C_o_m_p_i_l_e_r _I_n_f_o_r_m_a_t_i_o_n _F_i_l_e (_C_I_F) _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l
  684.  
  685.      _M_I_P_S_p_r_o _F_o_r_t_r_a_n _7_7 _P_r_o_g_r_a_m_m_e_r'_s _G_u_i_d_e
  686.  
  687.      _M_I_P_S_p_r_o _7 _F_o_r_t_r_a_n _9_0 _C_o_m_m_a_n_d_s _a_n_d _D_i_r_e_c_t_i_v_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l
  688.  
  689.      _M_I_P_S_p_r_o _6_4-_B_i_t _P_o_r_t_i_n_g _a_n_d _T_r_a_n_s_i_t_i_o_n _G_u_i_d_e
  690.  
  691.      This man page is available only online.
  692.